﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Excel;

namespace TpBaseObjects.Base {
    public class ProjektWorkbook {

        #region Members

        List<ProjectSheet> mySheetList = new List<ProjectSheet>();
        List<Worksheet> mySheets = new List<Worksheet>();
        Workbook myWb;

        #endregion

        #region Constructor

        public ProjektWorkbook() {
        }

        public ProjektWorkbook(int projectNumber, Workbook wb)
            : this() {
            myWb = wb;
            foreach (Worksheet sh in wb.Sheets) {
                ProjectSheet sheet = new ProjectSheet(sh);
                if (sheet.ProjektNummer == projectNumber) {
                    mySheetList.Add(sheet);
                    mySheets.Add(sh);
                }
            }
        }

        #endregion

        #region Properties

        public List<Worksheet> WbSheets {
            get { return mySheets; }
        }

        public List<ProjectSheet> ProjektSheets {
            get { return mySheetList; }
        }

        #endregion

        #region Functions

        public Sheets MySheets() {
            return myWb.Sheets;
        }

        #endregion
        
    }
}
